#pragma once

#include <metalc/base/mlayer.h>

/* 未完成, 依赖mmeta记录调用链 */
#warning "not completed"


/* 计算异或编码 */
#define CCHAIN_NR	(8)
typedef struct xorcode{
	void *func_ptr[CCHAIN_NR];
}cchain_t;


CEFF_HANDLER(cchain, MMETA_CEFF_ALL)

SAI void   _cchain_pinit(const mlfunc_t * cont, const cchain_chdl_t * hdl){
	INFO("cchain pinit\n");
}
SAI void   _cchain_tinit(const mlfunc_t * cont, const cchain_chdl_t * hdl){
	INFO("cchain tinit\n");
}
SAI void   *_cchain_alloc(mreq_t *req, const mlfunc_t * cont, const cchain_chdl_t * hdl){
	return cont->lalloc(req);
}
SAI bool_t _cchain_free(mreq_t *req, const mlfunc_t * cont, const cchain_chdl_t * hdl){
	return cont->lfree(req);
}
SAI size_t _cchain_sizeof(mreq_t *req, const mlfunc_t * cont, const cchain_chdl_t * hdl){
	return cont->lsizeof(req);
}

